feat: support access key signing via root_account#93
Open
Conversation
Wire root_account into _build_tempo_transfer so that smart wallet access keys can sign transactions on behalf of the wallet: - Use root_account address for get_tx_params (nonce) and estimate_gas - Use pytempo.sign_tx_access_key() when root_account is set, which builds a Keychain V2 signature (0x04 || root_addr || inner_sig) - Set credential source to root_account address (the wallet) This enables passkey-based Tempo wallets with access keys to use pympp. Previously root_account was declared but unused. Works with fee payer (0x78 envelope) — tested end-to-end against modal.mpp.tempo.xyz. Amp-Thread-ID: https://ampcode.com/threads/T-019d0db3-f0b0-73aa-9403-704f79d8d9f1 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wire
root_accountinto_build_tempo_transferso that smart wallet access keys can sign transactions on behalf of the wallet.Changes
src/mpp/methods/tempo/client.py:root_accountaddress forget_tx_params(nonce comes from the wallet, not the access key)root_accountforestimate_gas(same reason)pytempo.sign_tx_access_key()whenroot_accountis set — builds a Keychain V2 signature (0x04 || root_addr || inner_sig) and setssender_addressto the walletsourceto theroot_accountaddresstests/test_tempo.py: 3 new tests covering access key signing, access key + fee payer, and the existing no-root-account path.Why
root_accountwas declared onTempoMethodbut never used. This meant passkey-based Tempo wallets (which use access keys with spending limits) could not use pympp — the transaction would be signed by the access key directly, which has no on-chain balance.Testing
modal.mpp.tempo.xyz: sandbox create → exec → terminate all succeed with access key + fee payer